public class text56 {
    public static int look(int[]arr,int left,int right,int target)
    {
        while(left<right)
        {
            int mid=(left+right)/2;
            if(arr[mid]>target)
            {
                right=mid-1;
            }
            else if(arr[mid]<target)
            {
                left=mid+1;
            }
            else
            {
                return mid;
            }
        }
        return -1;
    }
    public static void main(String[] args) {
        int []arr={2,4,6,8,9,11};
        int left=0;
        int right=arr.length-1;
        int target=9;
        int b=look(arr,0,right,target);
        System.out.println(b);
    }
}
